<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MQTT C Client Libraries Internals: MQTTPacketOut.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MQTT C Client Libraries Internals
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">MQTTPacketOut.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>functions to deal with reading and writing of MQTT packets from and to sockets  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;MQTTPacketOut.h&quot;</code><br />
<code>#include &quot;Log.h&quot;</code><br />
<code>#include &quot;StackTrace.h&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &quot;Heap.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for MQTTPacketOut.c:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c__incl.png" border="0" usemap="#MQTTPacketOut_8c" alt=""/></div>
<map name="MQTTPacketOut_8c" id="MQTTPacketOut_8c">
<area shape="rect" title="functions to deal with reading and writing of MQTT packets from and to sockets" alt="" coords="16,5,147,32"/>
<area shape="rect" title=" " alt="" coords="5,80,69,107"/>
<area shape="rect" title=" " alt="" coords="94,80,157,107"/>
</map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad3c3f0919760286998e9b9eafaa47a36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#ad3c3f0919760286998e9b9eafaa47a36">MQTTPacket_send_connect</a> (<a class="el" href="structClients.html">Clients</a> *client, int MQTTVersion, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *connectProperties, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *willProperties)</td></tr>
<tr class="memdesc:ad3c3f0919760286998e9b9eafaa47a36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT CONNECT packet down a socket for V5 or later.  <a href="MQTTPacketOut_8c.html#ad3c3f0919760286998e9b9eafaa47a36">More...</a><br /></td></tr>
<tr class="separator:ad3c3f0919760286998e9b9eafaa47a36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad05dd32a547e82e0741d9d8279568a65"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">MQTTPacket_connack</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
<tr class="memdesc:ad05dd32a547e82e0741d9d8279568a65"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create connack packets.  <a href="MQTTPacketOut_8c.html#ad05dd32a547e82e0741d9d8279568a65">More...</a><br /></td></tr>
<tr class="separator:ad05dd32a547e82e0741d9d8279568a65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49e8e6789e17a29f5a448b8fab0a4137"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a49e8e6789e17a29f5a448b8fab0a4137">MQTTPacket_freeConnack</a> (<a class="el" href="structConnack.html">Connack</a> *pack)</td></tr>
<tr class="memdesc:a49e8e6789e17a29f5a448b8fab0a4137"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free allocated storage for a connack packet.  <a href="MQTTPacketOut_8c.html#a49e8e6789e17a29f5a448b8fab0a4137">More...</a><br /></td></tr>
<tr class="separator:a49e8e6789e17a29f5a448b8fab0a4137"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf4b3402e224ac22ffbe74731f374fe0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#acf4b3402e224ac22ffbe74731f374fe0">MQTTPacket_send_pingreq</a> (<a class="el" href="structnetworkHandles.html">networkHandles</a> *net, const char *clientID)</td></tr>
<tr class="memdesc:acf4b3402e224ac22ffbe74731f374fe0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT PINGREQ packet down a socket.  <a href="MQTTPacketOut_8c.html#acf4b3402e224ac22ffbe74731f374fe0">More...</a><br /></td></tr>
<tr class="separator:acf4b3402e224ac22ffbe74731f374fe0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a90212ed29c311f52a1dce0617133b1a7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a90212ed29c311f52a1dce0617133b1a7">MQTTPacket_send_subscribe</a> (<a class="el" href="structList.html">List</a> *topics, <a class="el" href="structList.html">List</a> *qoss, <a class="el" href="structMQTTSubscribe__options.html">MQTTSubscribe_options</a> *opts, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *props, int msgid, int dup, <a class="el" href="structClients.html">Clients</a> *client)</td></tr>
<tr class="memdesc:a90212ed29c311f52a1dce0617133b1a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT subscribe packet down a socket.  <a href="MQTTPacketOut_8c.html#a90212ed29c311f52a1dce0617133b1a7">More...</a><br /></td></tr>
<tr class="separator:a90212ed29c311f52a1dce0617133b1a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee4b3e106128629671828ae7bfa70850"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">MQTTPacket_suback</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
<tr class="memdesc:aee4b3e106128629671828ae7bfa70850"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create suback packets.  <a href="MQTTPacketOut_8c.html#aee4b3e106128629671828ae7bfa70850">More...</a><br /></td></tr>
<tr class="separator:aee4b3e106128629671828ae7bfa70850"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a1ad4c9b76c6ab88c394ee925eb4dcd44">MQTTPacket_send_unsubscribe</a> (<a class="el" href="structList.html">List</a> *topics, <a class="el" href="structMQTTProperties.html">MQTTProperties</a> *props, int msgid, int dup, <a class="el" href="structClients.html">Clients</a> *client)</td></tr>
<tr class="memdesc:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send an MQTT unsubscribe packet down a socket.  <a href="MQTTPacketOut_8c.html#a1ad4c9b76c6ab88c394ee925eb4dcd44">More...</a><br /></td></tr>
<tr class="separator:a1ad4c9b76c6ab88c394ee925eb4dcd44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">MQTTPacket_unsuback</a> (int MQTTVersion, unsigned char aHeader, char *data, size_t datalen)</td></tr>
<tr class="memdesc:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function used in the new packets table to create unsuback packets.  <a href="MQTTPacketOut_8c.html#a93f6aa4b23d30f6c8c5be87b0b58e37c">More...</a><br /></td></tr>
<tr class="separator:a93f6aa4b23d30f6c8c5be87b0b58e37c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>functions to deal with reading and writing of MQTT packets from and to sockets </p>
<p>Some other related functions are in the <a class="el" href="structMQTTPacket.html" title="Data for a packet with header only.">MQTTPacket</a> module </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ad05dd32a547e82e0741d9d8279568a65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad05dd32a547e82e0741d9d8279568a65">&#9670;&nbsp;</a></span>MQTTPacket_connack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* MQTTPacket_connack </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>MQTTVersion</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>aHeader</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function used in the new packets table to create connack packets. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MQTTVersion</td><td>MQTT 5 or less? </td></tr>
    <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
    <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
    <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph" id="MQTTPacketOut_8c_ad05dd32a547e82e0741d9d8279568a65_cgraph">
<area shape="rect" title="Function used in the new packets table to create connack packets." alt="" coords="5,5,161,32"/>
<area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="209,5,284,32"/>
</map>
</div>

</div>
</div>
<a id="a49e8e6789e17a29f5a448b8fab0a4137"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49e8e6789e17a29f5a448b8fab0a4137">&#9670;&nbsp;</a></span>MQTTPacket_freeConnack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MQTTPacket_freeConnack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structConnack.html">Connack</a> *&#160;</td>
          <td class="paramname"><em>pack</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Free allocated storage for a connack packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pack</td><td>pointer to the connack packet structure </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad3c3f0919760286998e9b9eafaa47a36"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3c3f0919760286998e9b9eafaa47a36">&#9670;&nbsp;</a></span>MQTTPacket_send_connect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MQTTPacket_send_connect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>MQTTVersion</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
          <td class="paramname"><em>connectProperties</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
          <td class="paramname"><em>willProperties</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send an MQTT CONNECT packet down a socket for V5 or later. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td>a structure from which to get all the required values </td></tr>
    <tr><td class="paramname">MQTTVersion</td><td>the MQTT version to connect with </td></tr>
    <tr><td class="paramname">connectProperties</td><td>MQTT V5 properties for the connect packet </td></tr>
    <tr><td class="paramname">willProperties</td><td>MQTT V5 properties for the will message, if any </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph" id="MQTTPacketOut_8c_ad3c3f0919760286998e9b9eafaa47a36_cgraph">
<area shape="rect" title="Send an MQTT CONNECT packet down a socket for V5 or later." alt="" coords="5,132,193,159"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="287,5,331,32"/>
<area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="241,56,376,83"/>
<area shape="rect" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923" title="Writes one character to an output buffer." alt="" coords="270,107,347,133"/>
<area shape="rect" href="MQTTPacket_8c.html#a8886398fbf89872f8e593444d351a5aa" title="Writes length delimited data to an output buffer." alt="" coords="270,157,347,184"/>
<area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="489,208,554,235"/>
<area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="271,259,347,285"/>
<area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="447,5,596,32"/>
<area shape="rect" href="MQTTPersistence_8c.html#a879b91862bb099e16ca81e57ba36e3fe" title="Adds a record to the persistent store." alt="" coords="424,56,619,83"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="490,107,553,133"/>
</map>
</div>

</div>
</div>
<a id="acf4b3402e224ac22ffbe74731f374fe0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf4b3402e224ac22ffbe74731f374fe0">&#9670;&nbsp;</a></span>MQTTPacket_send_pingreq()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MQTTPacket_send_pingreq </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnetworkHandles.html">networkHandles</a> *&#160;</td>
          <td class="paramname"><em>net</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>clientID</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send an MQTT PINGREQ packet down a socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
    <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph" id="MQTTPacketOut_8c_acf4b3402e224ac22ffbe74731f374fe0_cgraph">
<area shape="rect" title="Send an MQTT PINGREQ packet down a socket." alt="" coords="5,31,189,57"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="283,5,327,32"/>
<area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="237,56,372,83"/>
<area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="443,5,592,32"/>
<area shape="rect" href="MQTTPersistence_8c.html#a879b91862bb099e16ca81e57ba36e3fe" title="Adds a record to the persistent store." alt="" coords="420,56,615,83"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="486,107,549,133"/>
</map>
</div>

</div>
</div>
<a id="a90212ed29c311f52a1dce0617133b1a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90212ed29c311f52a1dce0617133b1a7">&#9670;&nbsp;</a></span>MQTTPacket_send_subscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MQTTPacket_send_subscribe </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
          <td class="paramname"><em>topics</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
          <td class="paramname"><em>qoss</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMQTTSubscribe__options.html">MQTTSubscribe_options</a> *&#160;</td>
          <td class="paramname"><em>opts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
          <td class="paramname"><em>props</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msgid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dup</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
          <td class="paramname"><em>client</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send an MQTT subscribe packet down a socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topics</td><td>list of topics </td></tr>
    <tr><td class="paramname">qoss</td><td>list of corresponding QoSs </td></tr>
    <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
    <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
    <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
    <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph" id="MQTTPacketOut_8c_a90212ed29c311f52a1dce0617133b1a7_cgraph">
<area shape="rect" title="Send an MQTT subscribe packet down a socket." alt="" coords="5,132,204,159"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="260,5,379,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="297,56,341,83"/>
<area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="252,107,387,133"/>
<area shape="rect" href="MQTTPacket_8c.html#ad29ec8b2fbf0ec0195621b44f8945923" title="Writes one character to an output buffer." alt="" coords="281,157,358,184"/>
<area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="499,233,565,260"/>
<area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="281,259,357,285"/>
<area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="457,56,607,83"/>
<area shape="rect" href="MQTTPersistence_8c.html#a879b91862bb099e16ca81e57ba36e3fe" title="Adds a record to the persistent store." alt="" coords="435,107,629,133"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="501,157,563,184"/>
</map>
</div>

</div>
</div>
<a id="a1ad4c9b76c6ab88c394ee925eb4dcd44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ad4c9b76c6ab88c394ee925eb4dcd44">&#9670;&nbsp;</a></span>MQTTPacket_send_unsubscribe()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MQTTPacket_send_unsubscribe </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structList.html">List</a> *&#160;</td>
          <td class="paramname"><em>topics</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structMQTTProperties.html">MQTTProperties</a> *&#160;</td>
          <td class="paramname"><em>props</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>msgid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dup</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structClients.html">Clients</a> *&#160;</td>
          <td class="paramname"><em>client</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send an MQTT unsubscribe packet down a socket. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">topics</td><td>list of topics </td></tr>
    <tr><td class="paramname">msgid</td><td>the MQTT message id to use </td></tr>
    <tr><td class="paramname">dup</td><td>boolean - whether to set the MQTT DUP flag </td></tr>
    <tr><td class="paramname">socket</td><td>the open socket to send the data to </td></tr>
    <tr><td class="paramname">clientID</td><td>the string client identifier, only used for tracing </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the completion code (e.g. TCPSOCKET_COMPLETE) </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph" id="MQTTPacketOut_8c_a1ad4c9b76c6ab88c394ee925eb4dcd44_cgraph">
<area shape="rect" title="Send an MQTT unsubscribe packet down a socket." alt="" coords="5,107,217,133"/>
<area shape="rect" href="LinkedList_8c.html#a7c6fba7f4b569c69829676bed2852ee9" title="Forward iteration through a list." alt="" coords="273,5,392,32"/>
<area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="311,56,355,83"/>
<area shape="rect" href="MQTTPacket_8c.html#a51f58f1c7864f9fe87b55cc6ccb10129" title="Sends an MQTT packet in one system call write." alt="" coords="265,107,400,133"/>
<area shape="rect" href="MQTTPacket_8c.html#a07aa0146eda3d32979142e7df8ad5fc3" title="Writes an integer as 2 bytes to an output buffer." alt="" coords="513,208,578,235"/>
<area shape="rect" href="MQTTPacket_8c.html#af0fcaa11ac05ce448a433a53f9cae420" title="Writes a &quot;UTF&quot; string to an output buffer." alt="" coords="295,208,371,235"/>
<area shape="rect" href="MQTTPacket_8c.html#aadd77a4fa1b2d5c7791e3542c56af856" title="Encodes the message length according to the MQTT algorithm." alt="" coords="471,56,620,83"/>
<area shape="rect" href="MQTTPersistence_8c.html#a879b91862bb099e16ca81e57ba36e3fe" title="Adds a record to the persistent store." alt="" coords="448,107,643,133"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="514,157,577,184"/>
</map>
</div>

</div>
</div>
<a id="aee4b3e106128629671828ae7bfa70850"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee4b3e106128629671828ae7bfa70850">&#9670;&nbsp;</a></span>MQTTPacket_suback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* MQTTPacket_suback </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>MQTTVersion</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>aHeader</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function used in the new packets table to create suback packets. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT </td></tr>
    <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
    <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
    <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph" id="MQTTPacketOut_8c_aee4b3e106128629671828ae7bfa70850_cgraph">
<area shape="rect" title="Function used in the new packets table to create suback packets." alt="" coords="5,107,155,133"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="204,5,292,32"/>
<area shape="rect" href="LinkedList_8c.html#a276950531b3f54e0dda27d597572c192" title="Removes and frees all items in a list, and frees the list itself." alt="" coords="213,56,283,83"/>
<area shape="rect" href="LinkedList_8c.html#a27e2cccab9752618ead91eafbe2a9a46" title="Allocates and initializes a new list structure." alt="" coords="203,107,293,133"/>
<area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="211,157,285,184"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="217,208,279,235"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="341,5,484,32"/>
<area shape="rect" href="LinkedList_8c.html#a3cf8578dba23f97dd0411e85fe3b7ff2" title="Removes and frees all items in a list, leaving the list ready for new items." alt="" coords="373,56,453,83"/>
<area shape="rect" href="LinkedList_8c.html#aa254fb1eab8e30d0e03859b333dc22ed" title="Sets a list structure to empty &#45; all null values." alt="" coords="377,107,448,133"/>
</map>
</div>

</div>
</div>
<a id="a93f6aa4b23d30f6c8c5be87b0b58e37c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93f6aa4b23d30f6c8c5be87b0b58e37c">&#9670;&nbsp;</a></span>MQTTPacket_unsuback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* MQTTPacket_unsuback </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>MQTTVersion</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>aHeader</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>datalen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function used in the new packets table to create unsuback packets. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">MQTTVersion</td><td>the version of MQTT </td></tr>
    <tr><td class="paramname">aHeader</td><td>the MQTT header byte </td></tr>
    <tr><td class="paramname">data</td><td>the rest of the packet </td></tr>
    <tr><td class="paramname">datalen</td><td>the length of the rest of the packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pointer to the packet structure </dd></dl>
<div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph.png" border="0" usemap="#MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph" alt=""/></div>
<map name="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph" id="MQTTPacketOut_8c_a93f6aa4b23d30f6c8c5be87b0b58e37c_cgraph">
<area shape="rect" title="Function used in the new packets table to create unsuback packets." alt="" coords="5,107,168,133"/>
<area shape="rect" href="LinkedList_8c.html#abc7a28449893dfa775c2f709349968b4" title="Append an item to a list." alt="" coords="217,5,305,32"/>
<area shape="rect" href="LinkedList_8c.html#a276950531b3f54e0dda27d597572c192" title="Removes and frees all items in a list, and frees the list itself." alt="" coords="226,56,297,83"/>
<area shape="rect" href="LinkedList_8c.html#a27e2cccab9752618ead91eafbe2a9a46" title="Allocates and initializes a new list structure." alt="" coords="216,107,307,133"/>
<area shape="rect" href="MQTTPacket_8c.html#aff1d10b221f5b4ce421b4c2588cbe511" title="Reads one character from the input buffer." alt="" coords="224,157,299,184"/>
<area shape="rect" href="MQTTPacket_8c.html#a132d2d5b304d37cd2348a973f7b315de" title="Calculates an integer from two bytes read from the input buffer." alt="" coords="230,208,293,235"/>
<area shape="rect" href="LinkedList_8c.html#a321a3598d6979c7af3f995b77ea2cec3" title="Append an already allocated ListElement and content to a list." alt="" coords="355,5,497,32"/>
<area shape="rect" href="LinkedList_8c.html#a3cf8578dba23f97dd0411e85fe3b7ff2" title="Removes and frees all items in a list, leaving the list ready for new items." alt="" coords="386,56,466,83"/>
<area shape="rect" href="LinkedList_8c.html#aa254fb1eab8e30d0e03859b333dc22ed" title="Sets a list structure to empty &#45; all null values." alt="" coords="391,107,461,133"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 24 2021 18:05:54 for MQTT C Client Libraries Internals by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
